﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PeoplesJukebox.Web.ServiceClients;
using PeoplesJukebox.Web.Enums;

namespace PeoplesJukebox.Web.Bases
{
    /// <summary>
    /// Base class for user controls
    /// </summary>
    public class UserControlBase : UserControl
    {
        private PlayerServiceClient _playerServiceClient;
        private CatalogueServiceClient _catalogueServiceClient;

        /// <summary>
        /// Returns a client for the media player service
        /// </summary>
        protected PlayerServiceClient PlayerServiceClient
        {
            get
            {
                if (_playerServiceClient == null)
                {
                    _playerServiceClient = new PlayerServiceClient();
                }
                return _playerServiceClient;
            }
        }

        /// <summary>
        /// Returns a client for the media catalogue service
        /// </summary>
        protected CatalogueServiceClient CatalogueServiceClient
        {
            get
            {
                if (_catalogueServiceClient == null)
                {
                    _catalogueServiceClient = new CatalogueServiceClient();
                }
                return _catalogueServiceClient;
            }
        }
    }
}